// components/pop_window/pop.js
const app = getApp();

Component({
  options: {
    multipleSlots: true 
  },
  properties: {
    data: {
      type: Object,
      value: '',
      observer: function (newVal, oldVal, changedPath) {

      }
    }
  },
  data: {
    navBarHeight: app.globalData.height,
    time : 202,
    animationData:''
  },
  ready:function(){
    this.animation('start');
  },

  /**
   * 组件的方法列表
   */
  methods: {
    animation:function(p){
      let animation = wx.createAnimation({
        duration: this.data.time,
        timingFunction: "ease",
        delay: 0,
        transformOrigin: "50% 50%",
      });
      if(p === 'start'){
        animation.translate(0).step();
      }else if(p === 'end'){
        animation.translate(0, '100%').step();
      }
      this.setData({
        animationData: animation.export(),
      });
    },
    closePop:function(){
      this.animation('end');
    },
    voidFun:function(){
      return
    }
  }
})
